package nc.bs.lm.bznjh;

import nc.bs.pub.pf.IQueryData;
import nc.bs.pub.pf.IQueryData2;
import nc.bs.trade.business.HYPubBO;
import nc.vo.lm.bznjh.bznjh_b;
import nc.vo.lm.bznjh.bznjh_h;
import nc.vo.pub.BusinessException;
import nc.vo.pub.CircularlyAccessibleValueObject;
import nc.vo.scm.pu.PuPubVO;

public class CaRefQryPubDMO implements IQueryData, IQueryData2 {
	
	HYPubBO bo = new HYPubBO();

	public CircularlyAccessibleValueObject[] queryAllBodyData(String key)
			throws BusinessException {
		// TODO Auto-generated method stub
		String where = " cbznjhhid = '"+key+"' and isnull(dr,0)=0";
		return bo.queryByCondition(bznjh_b.class, where);
	}

	public CircularlyAccessibleValueObject[] queryAllHeadData(String whereString)
			throws BusinessException {
		// TODO Auto-generated method stub
		return bo.queryByCondition(bznjh_h.class, whereString);
	}

	public CircularlyAccessibleValueObject[] queryAllBodyData(String key,
			String whereString) throws BusinessException {
		// TODO Auto-generated method stub
		String where = " cbznjhhid = '"+key+"' and isnull(dr,0)=0 ";
		if(PuPubVO.getString_TrimZeroLenAsNull(whereString)!=null)
			where = where + whereString;
		return bo.queryByCondition(bznjh_b.class, where);
	}

}
